<template>
	<view>
		<view class="balance">
			<hx-navbar ref="hxnb" :config="config" />
			<view class="flex" style="justify-content: space-between;align-items: center;padding:30rpx">
				<view style="font-weight: 500;color: #FFFFFF;">
					<view style="font-size: 36rpx;">
						账户余额(元)
					</view>
					<view style="font-size: 56rpx;font-family: Rubik-Medium, Rubik;margin-top: 24rpx;">
						{{balanceList.balance}}
					</view>
				</view>
				<view class="withdrawals" @click="Withdrawal()">
					立即提现
				</view>
			</view>
		</view>
		<view class="revenue">
			<view class="flex" style="border-bottom: 1rpx solid rgba(30, 30, 30, 0.1);">
				<view class="revenue_s" style="border-right: 1rpx solid rgba(30, 30, 30, 0.1);">
					<view class="titl">总营收(元)</view>
					<view class="number">{{balanceList.grossRevenue}}</view>
				</view>
				<view class="revenue_s">
					<view class="titl">预计收入(元)</view>
					<view class="number">{{balanceList.estimate}}</view>
				</view>
			</view>
			<view class="flex">
				<view class="revenue_s" style="border-right: 1rpx solid rgba(30, 30, 30, 0.1);">
					<view class="titl">本月接单</view>
					<view class="number">0</view>
				</view>
				<view class="revenue_s flex" @click="bankCard()"
					style="flex-direction: row; align-items: center; justify-content: space-between;">
					<view>
						<view class="titl">银行卡</view>
						<view class="number">{{card}}</view>
					</view>
					<image style="width:48rpx;height:48rpx;" src="../../../static/me/right.png" mode=""></image>
				</view>
			</view>
		</view>
		<!--  -->
		<view style="position: absolute;width:100%;top: 810rpx;">
			<view>
				<view class="title_t" v-if="year != ''">
					{{year}}月
				</view>
				<view class="recording flex" v-for="(item,index) in balanceList.pageResult.list" :key="index"
					style="align-items: center; justify-content: space-between;" @click="PayoutDetails(item)">
					<view class="flex">
						<image style="width: 92rpx;height:92rpx" src="../../../static/me/7970.png" mode=""></image>
						<view>
							<h4 style="font-size: 32rpx;">{{item.remark}}</h4>
							<view style="font-size: 28rpx;color: rgba(30,30,30,0.3);margin-top: 15rpx;">
								{{item.createTime}}
							</view>
						</view>
					</view>
					<view style="font-family: Rubik-Regular, Rubik;font-weight: 500;font-size: 44rpx;">
						<text v-if="item.status != 1">-</text>{{item.money}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				config: {
					title: '',
					color: '#FFFFFF',
					backgroundColor: [1, ''],
					border: true,
					// #ifdef H5
					backPage: '',
					// #endif
				},
				balanceList: [],
				card: '',
				year: '',
			}
		},
		onLoad(e) {
			let data = JSON.parse(e.data)
			this.balanceList = data
			this.card = this.balanceList.sysBankCards.length
			this.balanceList.pageResult.list.forEach((item) => {
				this.year = item.createTime.slice(6, 7)
			})
		},
		methods: {
			goBack() {
				uni.navigateBack()
			},
			// 银行卡
			bankCard() {
				this.$tools.goPageNoAuth('/clientEnd/page/revenue/bankCard')
			},
			// 提现申请
			Withdrawal() {
				this.$tools.goPageNoAuth('/clientEnd/page/revenue/WithdrawalRequest')
			},
			// 提现详情
			PayoutDetails(e) {
				this.$tools.goPageNoAuth('/clientEnd/page/revenue/PayoutDetails?data=' + JSON.stringify(e))
			}
		},

	}
</script>

<style scoped>
	.recording {
		background-color: #fff;
		padding: 30rpx;
	}

	.title_t {
		padding: 30rpx;
		font-size: 36rpx;
		font-family: Noto Sans SC-Medium, Noto Sans SC;
		font-weight: 500;
		color: #1E1E1E;
	}

	.number {
		font-size: 40rpx;
		font-family: Rubik-Regular, Rubik;
		font-weight: 500;
		margin-top: 20rpx;
	}

	.titl {
		font-size: 32rpx;
		font-family: Noto Sans SC-Regular, Noto Sans SC;
	}

	.revenue_s {
		width: 345rpx;
		height: 176rpx;
		padding: 30rpx;
		color: #1E1E1E;
		font-weight: 400;
		line-height: 48rpx;
	}

	.revenue {
		padding: 30rpx;
		background-color: #fff;
		position: absolute;
		top: 398rpx;
	}

	.balance {
		width: 750rpx;
		height: 398rpx;
		background: #492D22;
	}

	.withdrawals {
		width: 248rpx;
		height: 92rpx;
		background: #FFFFFF;
		border-radius: 20rpx 20rpx 20rpx 20rpx;
		opacity: 1;
		text-align: center;
		line-height: 92rpx;
		color: #492D22;
	}
</style>
